package com.aop;

import com.Service.UserService;
import com.javabean.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring.xml")

public class SpringTest {
    @Autowired
    User user;
    @Autowired
    UserService userService;
    @Test
    public void aop(){
        userService.findAll();
    }
    @Test
    public void pointcut(){
        System.out.println(user);
        System.out.println(user.getName());
        user.setId(1);
        userService.findAll();
        userService.findOne(1);
        userService.update();
    }
    @Test
    public void findOne(){
        userService.findOne(2);
    }
    @Test
    public void findAdd(){
        userService.findAdd(1,2);
    }

}

}
